1. Field of the Invention
The present invention is related to a data communication method of a USB data communication apparatus capable of selectively switching a master function and a slave function.
2. Description of the Related Art
Very recently, USB data communication apparatus operable in accordance with the USB OTG (Universal Serial Bus On-The-Go) specification have been developed. In the USB OTG specification, between 2 sets of USB data communication apparatus directly connected to each other, such a USB mother/daughter relationship as a “master” and a “slave” may be arbitrarily exchanged without changing connections of cables.
FIG. 8 is a diagram for showing a schematic arrangement of a conventional USB system in which USB data communication apparatus (namely, both USB data communication apparatus 600 and 620) as connected which are operable in accordance with the USB OTG specification. In a USB system operable in accordance with the USB OTG specification, an appliance to which a MINI-A plug of a USB cable is inserted firstly becomes a “master (A-Device)”, whereas another appliance to which another MINI-B plug of the USB cable is inserted firstly becomes a “slave (B-Device)”, while these appliances are operated.
Next, a description is made of a data transfer operation of the USB system with employment of the above-explained arrangement. FIG. 9 is a sequence diagram for indicating a sequential operation of the data transfer operation executed in the conventional USB system operable in accordance with the USB OTG specification. In the case that the MINI-A plug of the USB cable is inserted into a MINI-AB receptacle 630 of the USB data communication apparatus 600 and the MINI-B plug of the USB cable is inserted into a MINI-AB receptacle 640 of the USB data communication apparatus 620, and thus, a “master” appliance and a “slave” appliance are determined (step S600). The USB data communication apparatus 600 which becomes the master appliance acquires apparatus information (various sorts of information such as configuration, end point (will be referred to as “EP” hereinafter), OTG, descripter etc.) of the USB data communication apparatus 620 functioning as the slave appliance by using an FP0 (step S601). As a result, a data transfer operation is commenced between the USB data communication apparatus, while EP other than EP0 is used (step S602).
During USB data communication, in the case that the “master” appliance and the “slave” appliance are switched between the USB communication apparatus (step S610), after the USB data communication apparatus 620 which has just become the “master” appliance acquires apparatus information of the USB communication apparatus 600 which has just become the “slave” appliance (step S611), the USB data communication apparatus 620 starts a data transfer operation by using EP other than EP0 (step S612). As a consequence, even in such a case that a switching operation between the “master” appliance and the “slave” appliance again occurs (step S620), and thus, the present master/slave relationship is returned to the original master/slave relationship, the USB data communication apparatus 600 again acquires the apparatus information from the USB data communication apparatus 620 (step S621), and then, commences a data transfer operation (step S622).
It should be understood that in the USB OTG specification, since a switching operation of master/slave relationships is carried out after a USB bus has been transferred to a suspend status, suspend statuses are produced time master and slave appliances are switched.
On the other hand, other USB systems have been proposed (for instance, refer to Japanese Laid-open Patent Application 2001-256172 (page 5, FIG. 1)). That is, while the USB systems are arranged by a plurality of standard USB hosts (namely, appliances equipped with only USB host functions) and a plurality of USB devices (namely, appliances equipped with only USB device functions), the USB devices which are being used by the respective standard USB hosts may be used by other USB hosts without switching connections, if necessary. Even in such a USB system, when a “master” appliance and a “slave” appliance are switched, a USB data communication apparatus on the side of the “master” appliance acquires apparatus information from a USB data communication apparatus on the side of the “slave” apparatus, and thus, there are some cases that the above-described duplicated operations of acquiring the apparatus information are carried out.
As previously explained, in the conventional USB systems, every time the switching operations between the master and slave appliances are carried out, since the master-sided USB data communication apparatus acquires the apparatus information of the slave-sided USB data communication apparatus, a large number of redundant operations (namely, operations for acquiring apparatus information are carried out in duplicating manner) are performed in the USB systems in which the “master” appliance and the “slave” appliance are frequently switched.
Also, in the USB OTG specification, there is such a problem that a master/slave switching operation cannot be carried out in a data transfer operation via a standard hub. Also, when a master appliance and a slave appliance are switched, since a USB bus is brought into a suspend condition, there is another problem that a flexible setting operation cannot be carried out. That is, in the flexible setting operation, the master/slave appliance switching operation is carried out at arbitrary timing and/or in synchronism with an application program.